home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / wgt_tp1.zip / WGT04.PAS < prev    next >
Pascal/Delphi Source File  |  1992-07-05  |  1KB  |  46 lines

  1. {**************************************************************************
  2.                           WordUp Graphics Toolkit
  3.                                 Demo File
  4.                      Color Handling and Load Functions
  5.  
  6.  
  7.  This file demonstrates the use of some of the color functions available
  8.  with WGT.
  9.  **************************************************************************}
  10.  
  11. USES Graph,WGT,CRT;
  12.  
  13. VAR
  14.    grDriver, grMode : INTEGER;
  15.    x : INTEGER;
  16.    p : PALETTE;     { This is a type specific to WGT }
  17.  
  18. BEGIN
  19.      { Initialize graphics (see demo file #1) }
  20.      grDriver := INSTALLUSERDRIVER('VGA256',NIL);
  21.      grMode := 0;
  22.      INITGRAPH(grDriver,grMode,'c:\tp\bgi');
  23.  
  24.      _ClearDevice(0);
  25.  
  26.      { First load the demo palette file, then set the palette }
  27.      Load_Palette('demo.pal',p);
  28.      Set_Palette_Block(0,255,p);
  29.  
  30.      {Now lets draw some diagonal lines with different colors}
  31.      For x:=0 to 255 do begin
  32.          _setcolor(x);
  33.          _line(0,0,x,199);
  34.      end;
  35.  
  36.      {Now cycle a group of them until the users hits return}
  37.      repeat
  38.      color_rotate(100,150,up,p);
  39.      until keypressed;
  40.  
  41.      readln;
  42.  
  43.      { Now close the graphics system }
  44.  
  45.      CLOSEGRAPH;
  46. END.